<?php

namespace App\Structs;

class StructBase
{
    public function __construct($data = [])
    {
        foreach ($data as $key => $val) {
            $this->$key = $val;
        }
    }

    public function toArray()
    {
        $data = [];
        foreach ($this as $key => $val) {
            $data[$key] = $val;
        }

        return $data;
    }
}
